package org.one.afternoon.forest;

import com.dtflys.forest.annotation.*;
import org.springframework.stereotype.Component;


@ForestClient
@Component
public interface FrontendClient {
    /**
     * 访问外部health接口
     * @param ip 目标ip地址
     * @return 前置机状态
     */
    @Get(url = "{ip}/account/health",headers = {"x-pwd:wjw-test","Content-Type:application/xml"})
    String isHealth(@Var("ip") String ip);

    /**
     * 访问外部customers_sign接口
     * @param ip 目标ip地址
     * @return 签名
     */
    @Get(url = "{ip}/account/customers_sign",headers = {"x-pwd:wjw-test","Content-Type:application/xml"})
    String getCustomersSign(@Var("ip")String ip);

    /**
     * 访问外部is_preferential接口
     * @param ip 目标ip地址
     * @param body xml片段
     * @return 审核信息
     */
    @Post(url = "{ip}/account/is_preferential",headers = {"x-pwd:wjw-test","Content-Type:application/xml"})
    String getCustomersInfo(@Var("ip")String ip,@XMLBody String body);

    /**
     * 访问外部sync_customersV2接口
     * @param formatDate 同步时间
     * @return OK/FAIL
     */
    @Get(url = "{ip}/account/sync_customersV2",headers = {"Content-Type: application/xml","x-wj-version: 1","x-pwd: wjw-test"})
    String syncCustomersV2(@Var("ip")String formatDate);
}
